package 周赛.L342;

/**
 * @author chenhong
 * @version 1.0
 * @description TODO
 * @date 2023/4/23 10:34
 */
public class L6391 {
    public int sumOfMultiples(int n) {
        if (n <= 2)
            return 0;
        int ans = 0;
        for (int i = 3; i <= n; i++) {
            if (i % 3 == 0 || i % 5 == 0 || i % 7 == 0)
                ans += i;
        }
        return ans;

    }
}
